#!/usr/bin/env bash

set -e

if [ ! -f clean ]; then
    echo 'clean must be run within its container folder' 1>&2
    exit 1
fi

CURDIR=`pwd`
OLDGOPATH="$GOPATH"
export GOPATH="$CURDIR:$CURDIR/thirdparty"

go clean -i -r btcrobot

rm -rf pid
rm -rf bin
rm -rf pkg
rm -rf log

export GOPATH="$OLDGOPATH"
export PATH="$OLDPATH"

echo 'finished'